package UIFree.components
{
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;

	public class uif_arrowflat extends uif_ecomponent {
		private var _arrowCount	: int;
		private var _density	: Number;
		public function uif_arrowflat(parent:uif_component, ax:int=0, ay:int=0, asize: Number =0, acount: int=1, styleClass:String='') {
			_arrowCount = acount;
			_density	= 1;
			super(parent, ax, ay, asize, asize, styleClass);
		}
		
		public function get density(): Number {
			return _density;
		}
		
		public function set density(a_density: Number): void {
			_density = a_density;
			repaint();
		}
		
		override protected function paint(a_styleClass:String):void {
			begin2(style);
			var a_size: Number = width / 4;
			var step: Number = (_density)?(a_size / (_arrowCount - 1) * _density):0;
			var start: Number = ((_density)?(-a_size / 2 * _density):0) * 0.46;
			for (var i:int=0; i<_arrowCount; i++) {
				var pos: Number = start + i * step;
				graphics.moveTo(-a_size + pos, pos);
				graphics.lineTo(pos, pos);
				graphics.lineTo(pos, -a_size + pos);
			}
		}	
	}
}